FROM centos:6

RUN rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
RUN rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm
RUN yum update -y
RUN yum install -y php55w \
                   php55w-bcmath \
                   php55w-cli \
                   php55w-common \
                   php55w-devel \
                   php55w-fpm  \
                   php55w-gd \
                   php55w-imap \
                   php55w-ldap \
                   php55w-mbstring \
                   php55w-mcrypt \
                   php55w-mysql  \
                   php55w-odbc  \
                   php55w-pdo  \
                   php55w-pear \
                   php55w-pecl-igbinary \
                   php55w-xml \
                   php55w-xmlrpc \
                   php55w-opcache \
                   php55w-intl \
                   php55w-pecl-memcache \
                   php55w-soap \
                   php55w-imagick \
                   crontabs
RUN service crond start
RUN cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.bak
COPY start_php_fpm /usr/local/bin/
ENTRYPOINT ["start_php_fpm"]
EXPOSE 9000
CMD ["php-fpm"]
